// 封装提示框
export const showModal = (content, showCancel = false, title = "提示") => {
  return new Promise((resolve, reject) => {
    uni.showModal({
      title: title,
      content: content,
      showCancel: showCancel,
      success: (res) => {
        resolve(res);
      },
      fail: (err) => {
        reject(err);
      },
    });
  });
};
// 封装showToast
export const showToast = (content, icon = "none") => {
  return new Promise((resolve, reject) => {
    uni.showToast({
      title: content,
      icon: icon,
      success: (res) => {
        resolve(res);
      },
      fail: (err) => {
        reject(err);
      },
    });
  });
};
// 封装showLoading
export const showLoading = (content, mask = true) => {
  return new Promise((resolve, reject) => {
    uni.showLoading({
      title: content,
      mask: mask,
      success: (res) => {
        resolve(res);
      },
      fail: (err) => {
        reject(err);
      },
    });
  });
};

